/*
 * Charger.h
 *
 *  Created on: Dec 10, 2011
 *      Author: Michael Anderson
 *      Part of Team 955 Battery Cart project
 *      compiled on Eclipse with Arduino libraries and avr-gcc
 */

#ifndef CHARGER_H_
#define CHARGER_H_

#include <Arduino.h>
#include "Battery.h"
#include "EventManager.h"
#include "Timer.h"

class Charger {
public:
    Charger(Battery&, uint8_t, EventManager&);

    void run();
    bool connect();
    bool disconnect();
    charger_state getState();

private:
    uint8_t chargerID;
    uint8_t chargePin;
    unsigned long chargeStartTime;
    Battery *connectedBattery;
    charger_state state;
    EventManager *eManager;
};

#endif /* CHARGER_H_ */
